import datetime
import time


def isInFixedTimeFixedPrice(curbidlst):
    nowTime =  datetime.datetime.now().strftime("%H:%M")


    timeMin = time.strptime(nowTime, "%H:%M")[4]
    if not timeMin % 2 == 0:
        nowTime = (datetime.datetime.now() + datetime.timedelta(minutes = -1)).strftime("%H:%M")

    curbidlst = eval(curbidlst)
    for i in range(len(curbidlst)):
        start = curbidlst[i].get("time").split("-")[0]
        end = curbidlst[i].get("time").split("-")[1]
        nextStart = None
        if i+1 <= len(curbidlst) - 1:
            nextStart = curbidlst[i+1].get("time").split("-")[0]
        if nowTime >= start and nowTime <= end:
            where = 1
            if nowTime == start:
                where = 0
            elif nowTime == end:
                where = 2
            if nextStart:
                if end == nextStart:
                    if nowTime == end:
                        where = 0
                    else:
                        where = 1
            return {"inFixedTime":True,"fixedPrice":curbidlst[i].get('price'),'where':where}

    return {"inFixedTime":False,"fixedPrice":0.4,'where':1}